/*
 Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 
 Licensed under the Apache License, Version 2.0 (the "License").
 You may not use this file except in compliance with the License.
 A copy of the License is located at
 
 http://aws.amazon.com/apache2.0
 
 or in the "license" file accompanying this file. This file is distributed
 on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 express or implied. See the License for the specific language governing
 permissions and limitations under the License.
 */

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class AWSPinpointDeliveryClient, AWSPinpointContext, AWSPinpointEndpointProfile, AWSTask;

@interface AWSPinpointTargetingClient : NSObject

///
/// Returns the current endpoint.
/// - Warning: Calling this method from a non-main thread might result in a deadlock if the main queue is blocked
/// - Returns: An AWSPinpointEndpoint
- (AWSPinpointEndpointProfile*) currentEndpointProfile;

///
/// Requests the current endpoint.
/// - Parameter completion: a block that is called with the current endpoint
- (void) currentEndpointProfileWithCompletion:(void (^_Nonnull)(AWSPinpointEndpointProfile *profile))completion;

/**
 * Sends an update of the current endpoint
 */
- (AWSTask *)updateEndpointProfile;

/**
 * Updates with the provided endpoint profile, AWSPinpointTargetingClient attributes and metrics are added to the profile.
 */
- (AWSTask *)updateEndpointProfile:(AWSPinpointEndpointProfile*) endpointProfile;

/**
 * Adds the specified attribute to the current endpoint profile generated by this client.
 * @param theValue A list of strings with the values of the attribute
 * @param theKey the name of the attribute to add
 */
- (void)addAttribute:(NSArray *)theValue
              forKey:(NSString *)theKey;

/**
 * Removes the specified attribute from the current endpoint profile generated by this client.
 * @param theKey the key of the attribute to remove
 */
- (void)removeAttributeForKey:(NSString*) theKey;

/**
 * Adds the specified metric to the current endpoint profile generated by this client.
 * @param theValue the value of the metric
 * @param theKey the name of the metric to add
 */
- (void)addMetric:(NSNumber *)theValue
           forKey:(NSString *)theKey;

/**
 * Removes the specified metric from the current endpoint profile generated by this client.
 * @param theKey the key of the metric to remove
 */
- (void)removeMetricForKey:(NSString*) theKey;

@end

NS_ASSUME_NONNULL_END
